package com.yuqiao.read.design.iterator;

import java.util.Hashtable;
import java.util.Iterator;

public class CafeMenu implements Menu{

    Hashtable menuItems = new Hashtable();

    public CafeMenu() {
        addItem("ni","1",true,33.9);
        addItem("wo","2",true,33.6);
        addItem("ta","3",true,33.9);
        addItem("study","4",true,13.9);
        addItem("sing","5",true,33.9);
        addItem("lala","6",true,23.9);
        addItem("haha","7",true,37.9);
    }

    public void addItem(String name, String description, boolean vegetarian, double price) {
        MenuItem menuItem = new MenuItem(name, description, vegetarian, price);
        menuItems.put(menuItem.getName(),menuItem);
    }


    @Override
    public Iterator createIterator() {
        return menuItems.values().iterator();
    }
}
